package cn.rongdao.jrkabao.model.main.banner;

import com.mifengkong.frtools.http.request.HttpFunction;

import java.util.List;

import cn.rongdao.jrkabao.bean.main.banner.BannerBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 17/5/20
 */

public class BannerModel extends BaseKaMaoModel {

    public static BannerModel getInstance() {
        return getPresent(BannerModel.class);
    }

    public void execute(String code, Observer<List<BannerBean>> observer) {
        addParamStrings("code", code);
        Observable<List<BannerBean>> observable = mServletApi.getBannerData(mParams).map(new HttpFunction<List<BannerBean>>());
        toSubscribe(observable, observer);
    }
}
